<?php
/*
 * AonzZung 2012
*/

if (!defined('_PS_VERSION_'))
	exit;

class MiiggMain extends Module
{
	/** @var max image size */
	//protected $maxImageSize = 307200;

	public function __construct()
	{
		$this->name = 'miiggmain';
		$this->tab = 'front_office_features';
		$this->version = '1.0';
		$this->author = 'AonzZung';
		$this->need_instance = 0;
		
		parent::__construct();

		$this->displayName = $this->l('Miigg Main');
		$this->description = $this->l('Miigg Main.');
		$path = dirname(__FILE__);
		if (strpos(__FILE__, 'Module.php') !== false)
			$path .= '/../modules/'.$this->name;
		//include_once($path.'/XXX.php');
	}

	public function install()
	{
		if (!parent::install() OR !$this->registerHook('home'))
			return false;
		return true;
	}
	
	public function uninstall()
	{
		if (!parent::uninstall())
			return false;
	}

	public function hookHome($params)
	{
		global $cookie, $smarty;
		
//		$editorial = new EditorialClass(1, (int)$cookie->id_lang);
//		$smarty->assign(array(
//			'editorial' => $editorial,
//			'default_lang' => (int)$cookie->id_lang,
//			'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'),
//			'image_height' => Configuration::get('EDITORIAL_IMAGE_HEIGHT'),
//			'id_lang' => $cookie->id_lang,
//			'homepage_logo' => !Configuration::get('EDITORIAL_IMAGE_DISABLE') && file_exists('modules/editorial/homepage_logo.jpg'),
//			'image_path' => $this->_path.'homepage_logo.jpg'
//		));
		return $this->display(__FILE__, 'miiggmain.tpl');
	}
}
